3.169 \(\int \frac{-1+x^2}{25-6 x+x^2} \, dx\)

Optimal. Leaf size=23 \[ 3 \log \left (x^2-6 x+25\right )+x-2 \tan ^{-1}\left (\frac{x-3}{4}\right ) \]

[Out]

x - 2*ArcTan[(-3 + x)/4] + 3*Log[25 - 6*x + x^2]

________________________________________________________________________________________

Rubi [A]  time = 0.0349412, antiderivative size = 23, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 5, integrand size = 16, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.312, Rules used = {1657, 634, 618, 204, 628} \[ 3 \log \left (x^2-6 x+25\right )+x-2 \tan ^{-1}\left (\frac{x-3}{4}\right ) \]

Antiderivative was successfully verified.

[In]

Int[(-1 + x^2)/(25 - 6*x + x^2),x]

[Out]

x - 2*ArcTan[(-3 + x)/4] + 3*Log[25 - 6*x + x^2]

Rule 1657

Int[(Pq_)*((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[Pq*(a + b*x + c*x^2)^p, x
], x] /; FreeQ[{a, b, c}, x] && PolyQ[Pq, x] && IGtQ[p, -2]

Rule 634

Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[(2*c*d - b*e)/(2*c), Int[1/(a +
 b*x + c*x^2), x], x] + Dist[e/(2*c), Int[(b + 2*c*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x] &
& NeQ[2*c*d - b*e, 0] && NeQ[b^2 - 4*a*c, 0] &&  !NiceSqrtQ[b^2 - 4*a*c]

Rule 618

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 204

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTan[(Rt[-b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[-b, 2]), x] /
; FreeQ[{a, b}, x] && PosQ[a/b] && (LtQ[a, 0] || LtQ[b, 0])

Rule 628

Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[(d*Log[RemoveContent[a + b*x +
c*x^2, x]])/b, x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]

Rubi steps

\begin{align*} \int \frac{-1+x^2}{25-6 x+x^2} \, dx &=\int \left (1-\frac{2 (13-3 x)}{25-6 x+x^2}\right ) \, dx\\ &=x-2 \int \frac{13-3 x}{25-6 x+x^2} \, dx\\ &=x+3 \int \frac{-6+2 x}{25-6 x+x^2} \, dx-8 \int \frac{1}{25-6 x+x^2} \, dx\\ &=x+3 \log \left (25-6 x+x^2\right )+16 \operatorname{Subst}\left (\int \frac{1}{-64-x^2} \, dx,x,-6+2 x\right )\\ &=x-2 \tan ^{-1}\left (\frac{1}{4} (-3+x)\right )+3 \log \left (25-6 x+x^2\right )\\ \end{align*}

Mathematica [A]  time = 0.0050814, size = 23, normalized size = 1. \[ 3 \log \left (x^2-6 x+25\right )+x-2 \tan ^{-1}\left (\frac{x-3}{4}\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[(-1 + x^2)/(25 - 6*x + x^2),x]

[Out]

x - 2*ArcTan[(-3 + x)/4] + 3*Log[25 - 6*x + x^2]

________________________________________________________________________________________

Maple [A]  time = 0.05, size = 22, normalized size = 1. \begin{align*} x-2\,\arctan \left ( -3/4+x/4 \right ) +3\,\ln \left ({x}^{2}-6\,x+25 \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^2-1)/(x^2-6*x+25),x)

[Out]

x-2*arctan(-3/4+1/4*x)+3*ln(x^2-6*x+25)

________________________________________________________________________________________

Maxima [A]  time = 1.4844, size = 28, normalized size = 1.22 \begin{align*} x - 2 \, \arctan \left (\frac{1}{4} \, x - \frac{3}{4}\right ) + 3 \, \log \left (x^{2} - 6 \, x + 25\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2-1)/(x^2-6*x+25),x, algorithm="maxima")

[Out]

x - 2*arctan(1/4*x - 3/4) + 3*log(x^2 - 6*x + 25)

________________________________________________________________________________________

Fricas [A]  time = 1.70121, size = 69, normalized size = 3. \begin{align*} x - 2 \, \arctan \left (\frac{1}{4} \, x - \frac{3}{4}\right ) + 3 \, \log \left (x^{2} - 6 \, x + 25\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2-1)/(x^2-6*x+25),x, algorithm="fricas")

[Out]

x - 2*arctan(1/4*x - 3/4) + 3*log(x^2 - 6*x + 25)

________________________________________________________________________________________

Sympy [A]  time = 0.100963, size = 22, normalized size = 0.96 \begin{align*} x + 3 \log{\left (x^{2} - 6 x + 25 \right )} - 2 \operatorname{atan}{\left (\frac{x}{4} - \frac{3}{4} \right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x**2-1)/(x**2-6*x+25),x)

[Out]

x + 3*log(x**2 - 6*x + 25) - 2*atan(x/4 - 3/4)

________________________________________________________________________________________

Giac [A]  time = 1.33842, size = 28, normalized size = 1.22 \begin{align*} x - 2 \, \arctan \left (\frac{1}{4} \, x - \frac{3}{4}\right ) + 3 \, \log \left (x^{2} - 6 \, x + 25\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2-1)/(x^2-6*x+25),x, algorithm="giac")

[Out]

x - 2*arctan(1/4*x - 3/4) + 3*log(x^2 - 6*x + 25)